import request from "@/utils/request.js";

export class UserService {
    static getUserList(query) {
        return request({
            url: '/api/system/user/list',
            method: 'get',
            params: query
        })
    }

    static addUser(data) {
        return request({
            url: '/api/system/user/add',
            method: 'post',
            data: data
        })
    }

    static getUser(userId) {
        return request({
            url: '/api/system/user/' + userId,
            method: 'get'
        })
    }

    static updateUser(data) {
        return request({
            url: '/api/system/user',
            method: 'put',
            data: data
        })
    }

    static deleteUser(roleId){
        return request({
            url:'/api/system/user/'+roleId,
            method:'delete'
        })
    }

    static resetUserPwd(data){
        return request({
            url:'/api/system/user/resetPwd',
            data:data,
            method:'post'
        })
    }

    static registerUser(data){
        return request({
            url:'/api/system/user/register',
            data:data,
            method:'post'
        })
    }
}
